﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using VOL.Core.Utilities;
using VOL.Entity.AttributeManager;
using VOL.Smartmanufacturing.IServices.WatchedPlatform;

namespace VOL.WebApi.Controllers.Smartmanufacturing.WatchedPlatform
{

    [Route("api/visualizationplatform")]
    [PermissionTable(Name = "visualizationplatform")]
    //[Route("api/[controller]")]
    //[ApiController]
    public class visualizationplatformController : ControllerBase
    {

        private readonly ITicketsLedgerShow _ticketsLedgerShow;
        private readonly IMaintenanceShow _maintenanceShow;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="ticketsLedgerShow">工单台账列表显示</param>
        /// <param name="maintenanceShow">产品维护维护显示</param>
        public visualizationplatformController(ITicketsLedgerShow ticketsLedgerShow, IMaintenanceShow maintenanceShow)
        {
            _ticketsLedgerShow = ticketsLedgerShow;
            _maintenanceShow = maintenanceShow;
        }

        /// <summary>
        /// 工单台账列表显示
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetTicketsLedgerShow")]
        public async Task<WebResponseContent> GetTicketsLedgerShow()
        {
            return await _ticketsLedgerShow.GetTicketsLedgerShow();
        }

        /// <summary>
        /// 产品维护维护显示
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetMaintenanceShow")]
        public async Task<WebResponseContent> GetMaintenanceShow()
        {
            return await _maintenanceShow.GetMaintenanceShow();
        }
    }
}
